

To set up language on a website you must use DomLanguage class.<br><br>
First add to you index file this line. (Before creating DomSite object)
<pre class="code">
&lt;?php
DomLanguageController::c()
	->addLanguage('est') // define language Est. This also will be default language.
	->addLanguage('eng') // define language Eng
	->init(); // initialize languages
?&gt;
</pre>
In conf dir there should be two language files:<br>
1) lang.est.php<br>
2) lang.eng.php<br>
Sample language file contents
<pre class="code">
&lt;?php
$LANGUAGE = array(
	'siteTitle' => 'Sample index page',
	'currentDate' => 'Current date is [$date]!',
);
?&gt;
</pre>
<br>

 
<h2>Getting sentences</h2>
<pre class="code">
&lt;?php
echo DomLanguage::getk(); // current language key
echo DomLanguage::getl('mySentenceKey');
// dynamic sentences
echo DomLanguage::getl('greeting', array('firstName' => 'Oliver') ); 
// greeting => 'Hello, [$firstName]!' will be 'Hello, Oliver!'

// You can also use lang function. (Shorthand for DomLanguage::getl())
lang('greeting', array('firstName' => 'Oliver') )
// greeting => 'Hello, [$firstName]!' will be 'Hello, Oliver!'
?&gt;
</pre>

In Smarty/DomView templates<br>
Sample: (lang key=KEY REPLACEMENT_NAME=value)<br>

<h2>Using URL to switch language</h2>
It automatically uses $_GET['lang'] variable to change current language. If $_GET['lang'] value is not found in added languages default language will be used.
Also if language is changed using $_GET['lang'] it is stored in session and afterwards that language will be used as current.

